package com.nantian.logic.entity.mainEntity.campusEntity;

import javax.persistence.*;
import java.util.Objects;

@Entity
@Table(name = "campus", schema = "springBoot")
public class CampusEntity {
    private int id;
    private String campusname;
    private String introduce;
    private Integer universityid;
    private String campustype;
    private Integer level;
    private Integer scale;
    private Integer areaid;

    @Id
    @Column(name = "id")
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "introduce")
    public String getIntroduce() {
        return introduce;
    }

    public void setIntroduce(String introduce) {
        this.introduce = introduce;
    }

    @Basic
    @Column(name = "campustype")
    public String getCampustype() {
        return campustype;
    }

    public void setCampustype(String campustype) {
        this.campustype = campustype;
    }

    @Basic
    @Column(name = "level")
    public Integer getLevel() {
        return level;
    }

    public void setLevel(Integer level) {
        this.level = level;
    }

    @Basic
    @Column(name = "scale")
    public Integer getScale() {
        return scale;
    }

    public void setScale(Integer scale) {
        this.scale = scale;
    }

    public Integer getUniversityid() {
        return universityid;
    }

    public void setUniversityid(Integer universityid) {
        this.universityid = universityid;
    }

    public Integer getAreaid() {
        return areaid;
    }

    public void setAreaid(Integer areaid) {
        this.areaid = areaid;
    }

    public String getCampusname() {
        return campusname;
    }

    public void setCampusname(String campusname) {
        this.campusname = campusname;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        CampusEntity that = (CampusEntity) o;
        return id == that.id &&
                Objects.equals(introduce, that.introduce) &&
                Objects.equals(universityid, that.universityid) &&
                Objects.equals(campustype, that.campustype) &&
                Objects.equals(level, that.level) &&
                Objects.equals(scale, that.scale) &&
                Objects.equals(areaid, that.areaid)&&
                Objects.equals(campusname,this.campusname);
    }

    @Override
    public int hashCode() {

        return Objects.hash(id, campusname,introduce, universityid, campustype, level, scale, areaid);
    }
}
